<template>
	<view class="container">
		<view class="header_content" >
			<image class="header_image" src="../../static/images/dialog1.png" mode="aspectFit"></image>
		</view>
		<view class="letter">楼盘名称</view>
		<view class="input-box"><input class="input" type="text" placeholder="融圣国际" v-model="data.name" /></view>
		<view class="letter">预约类型</view>
		<picker mode="selector" :range="list" @change="pick($event)" :value="index">
			<view class="input-box">
				<view class="input">{{list[index]}}</view>
				<image class="image" src="../../static/images/right_icon.png"></image>
			</view>
		</picker>
		<view class="letter">户&emsp;&emsp;型</view>
		<view class="input-box">
			<input class="input" type="text" placeholder="150" v-model="data.model" /><text class="unit">(m²)</text>
		</view>
		<view class="letter">姓&emsp;&emsp;名</view>
		<view class="input-box"><input class="input" type="text" placeholder="刘芳" v-model="data.username" /></view>
		<view class="letter">联系方式</view>
		<view class="input-box">
			<input class="input" type="text" placeholder="12345678912" v-model="data.telephone" />
		</view>
		<view class="letter">微信号码</view>
		<view class="input-box">
			<input class="input" type="text" placeholder="13244455678" v-model="data.wechat" />
		</view>
		<view class="contents" @click="appointent()">
			<button type="primary" class="button-text">确定预约</button>
		</view>
		<view class="content_list" v-if="isShowDialog" @click="isShowDialog=false">
			<view class="index_dialog">
				<view class="index_imag">
					<image class="dialog_banner" src="../../static/images/success_icon.png" mode=""></image>
				</view>
				<view class="dialog_text">
					<text class="dialog_icon">恭喜预约成功</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: ['验房', '微改报价', '设计', '拎包入住'],
				index: 0,
				isShowDialog: false,
				data: {
					"name": "测试", //楼盘名称
					"type": "3", //预约类型
					"model": "100", //户型
					"telephone": "18100735042", //联系方式
					"wechat": "wwww", //微信号
					"username": "测试", //姓名
					"user_id": "1" //用户编号
				}
			}

		},
		methods: {
			pick(e) {
				this.index = e.target.value
			},
			appointent() {
				this.$http.post("/reserve/addReserveInfo", {}).then(res => {
					console.log(res);
					this.isShowDialog = true
				})

			}
		}

	}
</script>

<style>
	.container {
		width: 100%;
		height: 100%;
		background-color: #f5f5f5;
		display: flex;
		flex-direction: column;
	}

	.index_dialog {
		width: 300rpx;
		height: 228rpx;
		background: #FFFFFF;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		align-content: center;
		margin-top: 612rpx;

		border-radius: 18rpx;
	}

	.index_imag {
		width: 136rpx;
		height: 136rpx;
		margin-top: 20rpx;
		margin-bottom: 12rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		margin-left: 0rpx;
		padding-left: 0rpx;
	}

	.dialog_banner {
		width: 90%;
		height: 100%;
	}

	.dialog_text {
		margin-top: 0rpx;
		margin-bottom: 40rpx;
		width: 240rpx;
		height: 40rpx;
		margin-left: 10rpx;
		margin-right: 15rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.dialog_icon text {
		margin-bottom: 20rpx;

	}

	.header_content {
		height: 450rpx;
		width: 100%;
	}

	.header_image {
		width: 100%;
		height: 100%;
	}

	.letter {
		position: relative;
		left: 80rpx;
		top: 64rpx;
		width: 112rpx;
		height: 40rpx;
		font-size: 28rpx;
		font-weight: 500;
		text-align: center;
		color: #666666;
		line-height: 28rpx;
	}

	.input-box {
		position: relative;
		left: 230rpx;
		top: 8rpx;
		width: 486rpx;
		height: 60rpx;
		background: #FFFFFF;
		border: 2rpx solid rgba(0, 0, 0, 0.10);
		border-radius: 8rpx;
	}

	.input {
		position: relative;
		left: 28rpx;
		top: 15rpx;
		font-size: 24rpx;
		font-weight: 700;
		color: #333333;
		line-height: 24rpx;
	}

	.image {
		position: absolute;
		order: 0.2;
		right: 8rpx;
		width: 32rpx;
		height: 32rpx;
		top: 0;
		bottom: 0;
		margin: auto;
	}

	.unit {
		position: absolute;
		opacity: 0.2;
		right: 8rpx;
		top: 13rpx;
		bottom: 0rpx;
		margin: auto;
		font-weight: 700;
		font-size: 30rpx;
	}

	.contents {
		width: 100vw;
		bottom: 128rpx;
		box-sizing: content-box; //盒子模型
		margin-top: 40px;
		margin-bottom: 40px;
	}

	.button-text {
		position: relative;
		width: 328rpx;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		background: #3D9C36;
		border-radius: 8rpx;
	}

	.content_list {
		z-index: 999;
		position: fixed;
		width: 100%;
		height: 100%;
		display: flex;
		justify-content: center;
		background-color: rgba(0, 0, 0, 0.3);
	}
</style>